#header{

<link rel="stylesheet" href="/css_js/homepage/css/page2.css">

<link rel="stylesheet" href="/css_js/homepage/css/page3.css" />

<link rel="stylesheet" href="/css_js/homepage/css/page4.css" /> }# #body{
<!--正文-->

<div class="pb_content clearfix content" id="pb_content">
	<div class="left_section">
		<div class="core_title_wrap_bright clearfix" id="j_core_title_wrap" style="top: 0px;">
			<div class="core_title_bg j_core_title_bg"></div>
			<h3 class="core_title_txt pull-left text-overflow  " title="!!$output['title']!!" style="width: 416px">!!$output['title']!!</h3>

			<span class="core_title_btns pull-right">      
			<!--<a rel="noopener" id="lzonly_cntn" href="/p/5807299955?see_lz=1" alog-alias="lzonly" class="btn-sub btn-small"><span id="lzonly" class="d_lzonly_bdaside">只看楼主</span></a>
			<a rel="noopener" class="btn-sub btn-small j_favor" data-field="{&quot;status&quot;:0,&quot;is_anonym&quot;:false}">收藏</a>-->
			<a href="#foot" id="quick_reply" class="btn-small btn-sub j_quick_reply"><i class="icon-reply"></i>回复</a>
			</span>
			<div id="j_favthread" class="p_favthread">
				<p class="p_favthr_tip"></p>
			</div>
		</div>
		<div class="p_postlist" id="j_p_postlist">
			<!--正帖-->
			<div class="l_post l_post_bright j_l_post clearfix  ">
				<div class="d_author">
					<div class="louzhubiaoshi_wrap">
						<div class="louzhubiaoshi  j_louzhubiaoshi">
						</div>
					</div>
					<ul class="p_author">
						<li class="icon">
							<div class="icon_relative j_user_card">
								<a style="" target="_blank" class="p_author_face "><img username="wuzhizhemu" class="" src="!!$output['QQ_pic']!!"></a>
							</div>
						</li>

						<li class="d_name">

							<a class="p_author_name sign_highlight j_user_card">!!$output['nickname']!!</a>

						</li>

						<li class="l_badge" style="display:block;">
							<div class="p_badge">
								<a href="" target="_blank" class="user_badge d_badge_bright d_badge_icon3" title="本吧头衔11级，经验值5622，点击进入等级头衔说明页">
									<div class="d_badge_title "></div>
									<div class="d_badge_lv">!!$output['points']!!</div>
								</a>
							</div>
						</li>
					</ul>
				</div>
				<div class="d_post_content_main ">
					<div class="p_content  ">

						<div class="d_post_content j_d_post_content "> !!$output['msg']!!</div><br>

					</div>
					<div class="core_reply j_lzl_wrapper">
						<div class="core_reply_tail clearfix">
							<div class="j_lzl_r p_reply">
								<a href="#foot" class="lzl_link_unfold" style="display:;">回复</a>
							</div>
							<div class="post-tail-wrap"><span class="tail-info">1楼</span><span class="tail-info">!!$output['time']!!</span></div>

						</div>

					</div>
				</div>
			</div>
			<div id='comment'></div>
		</div>
	</div>
</div>

<!--输入框-->
<div class="foot" id="foot">
	<form class="layui-form layui-form-pane">
		<div hidden="">
			<input value="!!$output['Id']!!" name="PageId" />
			<input value="0" name="ReceiveId" />
		</div>
		<div class="layui-form-item layui-form-text">
			<div class="layui-input-block">
				<textarea class="layui-textarea layui-hide" name="msg" lay-verify="remsg" id="LAY_demo_editor0"></textarea>
			</div>
		</div>
		<div class="layui-form-item">
			<button class="layui-btn" lay-submit="" lay-filter="form00" style="background:#005097;">发表</button>
		</div>
	</form>
</div>

}# #footer{

<script type="text/html" id='temp3'>
	{%each(i,dt) result%}
	<div class="l_post l_post_bright j_l_post clearfix  ">
		<div class="d_author">
			{%if userId==!!$output['userId']!!%}
			<div class="louzhubiaoshi_wrap">
				<div class="louzhubiaoshi  j_louzhubiaoshi">
				</div>
			</div>
			{%/if%}
			<ul class="p_author">
				<li class="icon">
					<div class="icon_relative j_user_card">
						<a style="" target="_blank" class="p_author_face " href="/home/main?un=zmy%E7%8B%AC%E5%A5%8F&amp;ie=utf-8&amp;fr=pb"><img username="zmy独奏" class="" src="${QQ_pic}"></a>
					</div>
				</li>
				<li class="d_name" data-field="{&quot;user_id&quot;:571197141}">

					<a data-field="{&quot;un&quot;:&quot;zmy\u72ec\u594f&quot;}" alog-group="p_author" class="p_author_name j_user_card" href="/home/main?un=zmy%E7%8B%AC%E5%A5%8F&amp;ie=utf-8&amp;fr=pb" target="_blank">${nickname}</a>

				</li>

				<li class="l_badge" style="display:block;">
					<div class="p_badge">
						<a href="/f/like/level?kw=%E7%A7%A6%E6%97%B6%E6%98%8E%E6%9C%88&amp;ie=utf-8&amp;lv_t=lv_nav_intro" target="_blank" class="user_badge d_badge_bright d_badge_icon3" title="本吧头衔11级，经验值5821，点击进入等级头衔说明页">
							<div class="d_badge_title ">风云再起</div>
							<div class="d_badge_lv">11</div>
						</a>
					</div>
				</li>
			</ul>
		</div>
		<div class="d_post_content_main ">
			<div class="p_content">

				<div id="post_content_121012807029" class="d_post_content j_d_post_content "> ${msg}</div><br>

			</div>
			<div class="core_reply j_lzl_wrapper">
				<div class="core_reply_tail clearfix">
					<div class="j_lzl_r p_reply" data-field="{&quot;pid&quot;:121012807029,&quot;total_num&quot;:3}">
						{%if comment.length==0%}
						<a href="javascript:" class="lzl_link_unfold" onclick="$(this).parent().parent().next().css('display','block');$(this).next().css('display','block');$(this).css('display','none');saySomething('#comment${Id}','#label${Id}')" class="lzl_link_unfold" style="display:">回复</a>
						{%else%}
						<a href="javascript:" class="lzl_link_unfold" onclick="$(this).parent().parent().next().css('display','block');$(this).next().css('display','block');$(this).css('display','none')" class="lzl_link_unfold" style="display:	{%if comment.length==0%}block{%else%}none{%/if%};">回复({%= comment.length%})</a>{%/if%}

						<span class="lzl_link_fold" style="display: {%if comment.length>0%}block{%else%}none{%/if%};" onclick="$(this).parent().parent().next().css('display','none');$(this).prev().css('display','block');$(this).css('display','none')">收起回复</span>
					</div>

					<div class="post-tail-wrap"><span class="j_jb_ele">
					
					
						<span class="tail-info">14楼</span><span class="tail-info">${time}</span>
					</div>

				</div>

				<div class="j_lzl_container core_reply_wrapper" style="min-height: 0px;display:	{%if comment.length>0%}block{%else%}none{%/if%};">
					{%if comment.length>0%}
					<div class="j_lzl_c_b_a core_reply_content">

						<ul class="j_lzl_m_w" style="display:">

							{%each(i,dt) comment%}
							<li class="lzl_single_post j_lzl_s_p first_no_border">
								<a target="_blank" class="j_user_card lzl_p_p" href=""><img src="${QQ_pic}"></a>
								<div class="lzl_cnt">
									<a class="at j_user_card " target="_blank" href="" username="神荼在右郁垒左">{%if ReceiveId==0%}${nickname}{%else%}${nickname} 回复 ${ReceiveN}{%/if%}</a>:&nbsp;<span class="lzl_content_main">${msg}</span>
									<div class="lzl_content_reply"><span class="lzl_jb" style="display:none"><a rel="noopener" href="#" data-field="{'delete_mine':'0','user_name':'神荼在右郁垒左'}" class="lzl_jb_in">举报</a>&nbsp;|&nbsp;</span><span class="lzl_op_list j_lzl_o_l"></span><span class="lzl_time">${time}</span>
										<a onclick="recomment('#comment${rowId}','#label${rowId}',${userId},'${nickname}')" href="javascript:" class="lzl_s_r">回复</a>
									</div>
								</div>
							</li>
							{%/each%}
							<li class="lzl_li_pager j_lzl_l_p lzl_li_pager_s" data-field="{total_num:3,total_page:1}">
								<a class="j_lzl_p btn-sub btn-small pull-right" onclick="saySomething('#comment${Id}','#label${Id}')" href="javascript:"><i class="icon-reply"></i>我也说一句</a>
								<p>&nbsp;</p>
							</li>

						</ul>

					</div>{%/if%}
					<form class="layui-form layui-form-pane" style="width: 80%;
    float: right;    margin-top: 2rem;" hidden="">
						<label id="label${Id}"></label>
						<div hidden="">
							<input value="!!$output['Id']!!" name="PageId" />
							<input value="0" name="ReceiveId" id="comment${Id}" />
							<input value="${Id}" name="rowId" />
						</div>
						<div class="layui-form-item layui-form-text">
							<div class="layui-input-block">
								<textarea class="layui-textarea" name="msg" lay-verify="msg"></textarea>
							</div>
						</div>
						<div class="layui-form-item">
							<button class="layui-btn" lay-submit="" lay-filter="form000" style="background:#005097;float: right;">发表</button>
						</div>
					</form>

				</div>

			</div>
		</div>
	</div>
	{%/each%}
</script>
<script>
	function tieMsg() {
		post('!!SplitUrl("homepage/column/comment_json/{$output["Id"]}")!!', {}, function(dt) {
			$('#temp3').tmpl(dt).appendF('#comment');
		}, true)

	}
	tieMsg()
	layui.use(['form', 'layedit', 'laydate'], function() {
		var form = layui.form,
			layer = layui.layer,
			layedit = layui.layedit,
			laydate = layui.laydate;

		layedit.set({
			uploadImage: {
				url: '!!SplitUrl("homepage/column/tieEditUp/")!!', //接口url
				type: 'post' //默认post
			}
		});
		//注意：layedit.set 一定要放在 build 前面，否则配置全局接口将无效。

		//创建一个编辑器
		var editIndex = layedit.build('LAY_demo_editor0');

		//自定义验证规则
		form.verify({
			remsg: function(value) {
				value = layedit.getContent(editIndex);

				console.log(value)
				if(value.length < 3) {
					return '内容至少得3个字符啊';
				}
				layedit.sync(editIndex);
			},
			msg: function(value) {
				if(value.length < 3) {
					return '内容至少得3个字符啊';
				}

			}
		});
		//监听提交
		form.on('submit(form00)', function(data) {
			delete data.field.file;
			//			layer.alert(JSON.stringify(data.field), {
			//				title: '最终的提交信息'
			//			})
			//							return false;
			post('!!SplitUrl("homepage/column/commentupdate/")!!', data.field, function(x) {
				if(x.status){
						tieMsg()
					$('#LAY_layedit_1').contents().find('body').html('')
				}
				
				else
					layer.alert(x.result);
			}, true)
			return false;
		});

		form.on('submit(form000)', function(data) {
			delete data.field.file;
			//			layer.alert(JSON.stringify(data.field), {
			//				title: '最终的提交信息'
			//			})
			//							return false;
			post('!!SplitUrl("homepage/column/commentupdate/")!!', data.field, function(x) {
				if(x.status){
					tieMsg()
					
				}
					
				else
					layer.alert(x.result);
			}, true)
			return false;
		});

	})

	//回复
	function recomment(obj0, obj00, val0, val00) {
		$(obj0).val(val0);
		$(obj00).html('回复 {0}:'.format(val00))
		if($(obj00).parent().attr('hidden') != undefined)
			$(obj00).parent().removeAttr('hidden');

	}

	//说点什么
	function saySomething(obj0, obj00) {
		if($(obj0).val() != '0') {
			$(obj0).val('0');
			$(obj00).html('');
		} else {
			if($(obj00).parent().attr('hidden') != undefined)
				$(obj00).parent().removeAttr('hidden');
			else {
				$(obj00).parent().attr('hidden', '')
			}
		}
	}
</script>
}#